package com.kreao.korean.dto;

import com.kreao.korean.entity.Word;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class WordResponse {
    
    private Long id;
    private String korean;
    private String chinese;
    private String pronunciation;
    private String romanization;
    private String examples;
    private String notes;
    private Word.WordCategory category;
    private Word.WordLevel level;
    private Word.WordType wordType;
    private Boolean isFavorite;
    private Boolean isPublic;
    private Integer reviewCount;
    private Integer correctCount;
    private Integer wrongCount;
    private Double accuracy;
    private LocalDateTime lastReviewTime;
    private LocalDateTime nextReviewTime;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
    
    public static WordResponse fromEntity(Word word) {
        WordResponse response = new WordResponse();
        response.setId(word.getId());
        response.setKorean(word.getKorean());
        response.setChinese(word.getChinese());
        response.setPronunciation(word.getPronunciation());
        response.setRomanization(word.getRomanization());
        response.setExamples(word.getExamples());
        response.setNotes(word.getNotes());
        response.setCategory(word.getCategory());
        response.setLevel(word.getLevel());
        response.setWordType(word.getWordType());
        response.setIsFavorite(word.getIsFavorite());
        response.setIsPublic(word.getIsPublic());
        response.setReviewCount(word.getReviewCount());
        response.setCorrectCount(word.getCorrectCount());
        response.setWrongCount(word.getWrongCount());
        response.setAccuracy(word.getAccuracy());
        response.setLastReviewTime(word.getLastReviewTime());
        response.setNextReviewTime(word.getNextReviewTime());
        response.setCreatedAt(word.getCreatedAt());
        response.setUpdatedAt(word.getUpdatedAt());
        return response;
    }
} 